<%	
    # Create the helper
  	flex_scaffold_helper = FlexScaffoldHelper.new("#{actions.first.camelcase}")

-%>package <%= class_name.downcase.gsub('::','.') %>.command
{

	import com.adobe.cairngorm.control.CairngormEvent;
	
	import mx.collections.ArrayCollection;	
	
	import org.genuflex.control.GenuflexCairngormEvent;	
		
	import <%= class_name.downcase.gsub('::','.') %>.business.<%= actions.first.camelcase %>Delegate;
	import <%= class_name.downcase.gsub('::','.') %>.model.<%= file_name.camelcase %>ModelLocator;
	import <%= class_name.downcase.gsub('::','.') %>.vo.<%= actions.first.camelcase %>VO;

	public class <%= actions.first.camelcase %>DestroyCommand extends <%= actions.first.camelcase %>BaseCommand
	{	
		public override function execute(event:CairngormEvent) : void
		{
		    var delegate : <%= actions.first.camelcase %>Delegate = new <%= actions.first.camelcase %>Delegate( this )
		 	var genuflexEvent : GenuflexCairngormEvent = event as GenuflexCairngormEvent;
			var <%= flex_scaffold_helper.obj_name %> : <%= actions.first.camelcase %>VO = genuflexEvent.eventArguments['<%= flex_scaffold_helper.obj_name %>'] as <%= actions.first.camelcase %>VO;

			// Make the server call
			delegate.destroy<%= actions.first.camelcase %>(<%= flex_scaffold_helper.obj_name %>);		 
			
			//Remove it from the local cache
			model.dataCache.removeData(<%= actions.first.camelcase %>VO, <%= flex_scaffold_helper.obj_name %>);
		}
	}
}